Skip to content

feat(mcp): serve the BackWave tools on /mcp through McpToolAccess - #545

Merged
pdevito3 merged 2 commits into
mainfrom
feat/backwave-mcp
Nov 22, 2026
Merged

pdevito3 merged 2 commits into
mainfrom
feat/backwave-mcp

Conversation

@pdevito3

@pdevito3 pdevito3 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Why

AI agents should be able to watch and repair background jobs over MCP. BackWave ships this as BackWave.Pro.Mcp.

What changed

  • Bump every BackWave package from 1.7.0 to 1.9.0, and add BackWave.Pro and BackWave.Pro.Mcp.
  • AddMcp adds its tools to the one MCP server of the process, so the BackWave tools are on /mcp. Only a process that serves requests adds them.
  • McpToolAccess gives each tool of the BackWave.Pro.Mcp assembly the ManageAllTenants rule. A tool of another assembly with no [ToolAccess] still stops startup.
  • JobsMcp sets the gates of BackWave. Reads, requeue, and cancel are on. Pause and resume, a trigger of a schedule, a concurrency limit, and the payload and output of a job stay denied.
  • AddEntrypoints puts the app's MCP filters before BackWave's, so a denial is a permission_denied tool error with the app's telemetry. It also clears ServerInfo, which AddMcp sets to BackWave.
  • Docs: endpoints.md and background-jobs.md.

Tradeoffs

  • No separate /backwave-mcp endpoint. There is one MCP server for each DI container, so MapBackWaveProMcp would serve the app's tools too.
  • The gate is ManageAllTenants, not JobOperators. The tools show the jobs of all tenants, and an operator of the dashboard is never an agent.
  • AuthorizeView allows each request. BackWave's view gate covers the whole server, so a deny would also hide the app's tools.

Blast Radius

  • Every app from the template now references the BackWave Pro packages. Only a process that serves requests calls AddBackWavePro, so a Worker and the integration tests run without it. Pro is free under $1M of annual revenue and needs a license key (BackWave:ProLicense) above it. With no key it logs one notice.
  • BackWave 1.9.0 adds schema migrations 0002 to 0005, all additive.
  • ManageAllTenantsClientIds is empty by default, so a default deploy shows the tools to nobody.
  • The message of the exception that failed a job reaches the model through get_job. The docs tell job handlers to keep personal data out of exception messages.

Verification

  • dotnet build FullstackTemplate.slnx: 0 warnings.
  • Unit tests 2449/2449, functional 514/514, integration 590/590 (integration at the gated head).
  • New functional tests cover the tool list of an all-tenants client, a read, a requeue that reaches the store, a refused pause_queue, a permission_denied for a tenant admin and a delegated agent, and the server name.

Add BackWave.Pro.Mcp (BackWave 1.7.0 -> 1.9.0). Its tools join the one MCP
server of the app. McpToolAccess gives each tool of the BackWave assembly
the ManageAllTenants rule, and JobsMcp allows only requeue and cancel among
the writes. The app's filters run before BackWave's, and the server keeps
the name of the app.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a2045d-65f9-767c-a723-e94e1f37f5d4

Copy link
Copy Markdown
Owner Author

review-gate: passed e93f07b

Independent review (thermo-nuclear rubric + dotnet stack pack) found no high or medium findings. Low findings, all addressed in d703d40 except the last:

  • Docs promised no personal data reaches the model, but a failed job's exception message does. Docs now say so.
  • A direct call to a denied write was untested. Added all_tenants_manager_cannot_pause_a_queue.
  • ResolveActor reads ICallerIdentityResolver.Current synchronously. Kept: the identity is already resolved by the earlier filters, and the all-tenants path does no I/O.

A Worker process and the integration tests no longer take on the license
of BackWave Pro or log its notice.

Amp-Thread-ID: https://ampcode.com/threads/T-01a2045d-65f9-767c-a723-e94e1f37f5d4
Co-authored-by: Amp <amp@ampcode.com>
@pdevito3
pdevito3 merged commit 1676726 into main Nov 22, 2026
21 of 23 checks passed
@pdevito3
pdevito3 deleted the feat/backwave-mcp branch November 22, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant